#include "bird.h"
#include "ui_mainwindow.h"
#include<QPixmap>

#define WIDTH 432//窗口宽度
#define HEIGHT 644//窗口高度
QImage backimg;//背景


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setGeometry(QRect(500,100,WIDTH,HEIGHT));//画窗口
}

MainWindow::~MainWindow()
{
    delete ui;
}
 void MainWindow::paintEvent(QPaintEvent* event)
 {
     QPainter painter(this);
     painter.drawPixmap(0,0,WIDTH,HEIGHT,QPixmap(":/images/myimages/bg.png"));//初始化背景图片
 }